/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package mundialfp.view.tables.paisABM;

import java.awt.Container;
import javax.swing.GroupLayout;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import mundialfp.view.tables.TableCustom1;

/**
 *
 * @author pferraz
 */
public class TablePaisManager {
    
    public void createPaisTable(String name, int hPref, int vPref, TableCustom1 table, Container panel, JTextField txtPaisQuickSearch) {
        
        JScrollPane jScroll = new JScrollPane();
        jScroll.setViewportView(table);
        GroupLayout pnlLayout = new GroupLayout(panel);
        panel.setLayout(pnlLayout);
        if (name.equalsIgnoreCase("PaisABM")) {
            createLayoutAndFontsPaisABM(hPref, vPref, pnlLayout, jScroll, table, txtPaisQuickSearch);
        }
        
    }
    
    private void createLayoutAndFontsPaisABM(int hPref, int vPref, GroupLayout pnlLayout, JScrollPane jScroll, TableCustom1 table, JTextField txtPaisQuickSearch) {
       
        pnlLayout.setHorizontalGroup(
                pnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScroll, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                .addGroup(pnlLayout.createSequentialGroup()
                        .addComponent(txtPaisQuickSearch, javax.swing.GroupLayout.PREFERRED_SIZE, hPref, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 146, Short.MAX_VALUE))
        );
        pnlLayout.setVerticalGroup(
                pnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlLayout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(txtPaisQuickSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScroll, javax.swing.GroupLayout.PREFERRED_SIZE, vPref, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        
        table.setFont(new java.awt.Font("Trebuchet MS", 1, 14));
    }
    
}
